Component({
  properties: {
    src: {
      type: String,
      value: "/assets/image-header/header.png"
    },
    title: {
      type: String,
      value: "活动"
    }
  },
  data: {
    containerPaddingTop: 0,
    containerHeight: 0,
  },
  methods: {
    routeBack: function (e) {
      wx.navigateBack({
          fail(res) {
            console.log(res)
            wx.switchTab({
              url: "/pages/home/index",
              fail(res) {
                console.log(res)
              }
            })
          }
        }
      )
      ;
    }
  },
  lifetimes: {
    attached() {
      const res = wx.getMenuButtonBoundingClientRect();
      this.setData({
        // paddingTop : top y + half height
        containerPaddingTop: res.top,
        containerHeight: res.height
      })
    }
  }
});
